﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameMain : Sington<GameMain> {
    public TextAsset CSV;
   public  List<AutoData> DataList = new List<AutoData>();
    public int CurDataIndex=1;
    public int CreateItemCount = 20;
    int MapIndex = 1;
    int MaxMapIndex = 5;
    // Use this for initialization
    public void Init () {
       
       
	}

    private void InitData()
    {
        if (MapIndex >= MaxMapIndex)
        {
            CSV = ResMgr.Instance.LoadText("Map" + MaxMapIndex);
        }
        else
        CSV = ResMgr.Instance.LoadText("Map"+MapIndex);
        DataList .AddRange(GameHelp.Getdatas(CSV.text,MapIndex));
    }

    private void InitGoByData()
    {
        for (int i = 0; i < CreateItemCount; i++)
        {

        }
        foreach (var data in DataList)
        {
            if (data.type > 3)
                continue;
            BaseItem item = new BaseItem(data);
            item.RectTrans.SetParent(Main.Instance.AutoContainer,false);
        }
    }
}


